package br.pucrio.inf.csm.matchers.thesaurus;

import br.pucrio.inf.csm.Attribute;
import br.pucrio.inf.csm.Catalog;
import br.pucrio.inf.csm.IMatch;

/**
 * This interface represents a Thesauri Matcher for Catalogs. It is used to
 * align the terms taken from a thesaurus t1 with the terms taken from a
 * thesaurus t2.
 * 
 * @author agazola
 * 
 */
public interface ICatalogThesaurusMatcher {

	/**
	 * Computes and updates the mapping rate estimate between two terms (taken
	 * from different catalog thesauri).
	 * 
	 * TODO: atuaaaaaaaaaaaaaaaaaalizarrrrrrrr JAVADOC!
	 * 
	 * @param sourceTerm
	 *            A term taken from the source catalog thesaurus.
	 * @param targetTerm
	 *            The corresponding term taken from the target catalog
	 *            thesaurus.
	 * @return <code>true</code> if the rate estimate between term1 and term2
	 *         was correctly updated. <code>false</code> otherwise.
	 */
	public abstract ThesaurusMatchResult computeMatchRateEstimate(
			String sourceTerm, Catalog sourceCatalog, String targetTerm,
			Catalog targetCatalog, IMatch<Attribute> attributeMatch,
			ThesaurusMatchParameters params);

	/**
	 * Computes the mapping rate estimate between terms whose values contain the
	 * specified keywords. The obtained rate is used to match some thesauri
	 * terms.
	 * 
	 * TODO: atualizarrrrrrrr JAVADOC
	 * 
	 * @param keywords
	 *            A set o keywords separated by blank spaces.
	 * @return the match between two catalog thesaurus, obtained using the
	 *         specified keywords.
	 */
	public abstract IMatch<Object> matchThesauriByKeywords(String[] keywords,
			Catalog sourceCatalog, Catalog targetCatalog,
			IMatch<Attribute> attributeMatch, ThesaurusMatchParameters params);
}
